package com.billdowney.entity.system;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.billdowney.entity.base.BaseEntityIdByUUIDHex;

import io.swagger.annotations.ApiModelProperty;

/**
 * @ClassName: SystemDataDictionaryDirectory
 * @Description: 系统数据字典目录表
 * @author 超级小富翁 - BillDowney
 * @date 2018年8月27日 下午10:31:56
 */
@Entity
@Table(name = "system_directory")
public class SystemDirectory extends BaseEntityIdByUUIDHex {

	private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "名称")
	@Column(length = 30)
	private String name;
	@ApiModelProperty(value = "目录类别", notes = "用来区别多个种类的目录")
	@Enumerated(EnumType.STRING)
	@Column(length = 50)
	private SystemDirectoryType type;

	@OneToMany(targetEntity = SystemDirectory.class, fetch = FetchType.EAGER)
	@JoinColumn(name = "parent_id")
	@ApiModelProperty(value = "字典目录信息")
	private List<SystemDirectory> systemDirectories;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<SystemDirectory> getDirectories() {
		return systemDirectories;
	}

	public void setDirectories(List<SystemDirectory> systemDirectories) {
		this.systemDirectories = systemDirectories;
	}

	public SystemDirectoryType getType() {
		return type;
	}

	public void setType(SystemDirectoryType type) {
		this.type = type;
	}

	@Override
	public String toString() {
		return "SystemDirectory [name=" + name + ", type=" + type + "]";
	}

}
